# Contributor: Francesco Colista <fcolista@alpinelinux.org>
# Maintainer: Francesco Colista <fcolista@alpinelinux.org>
pkgname=py3-service_identity
_pkgname=service-identity
pkgver=23.1.0
pkgrel=0
pkgdesc="Service identity verification for pyOpenSSL & cryptography."
url="https://pypi.org/project/service-identity/"
arch="noarch"
license="MIT"
depends="py3-asn1 py3-asn1-modules py3-attrs py3-cryptography"
makedepends="py3-gpep517 py3-hatchling py3-hatch-vcs"
checkdepends="py3-idna py3-openssl py3-pytest-runner"
subpackages="$pkgname-pyc"
source="https://github.com/pyca/service-identity/archive/$pkgver/$pkgname-$pkgver.tar.gz
	remove-fancy-pypi-readme.patch
	"
builddir="$srcdir/$_pkgname-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
b891bcff542b989a8caf4df046d2b9fe1caf99fa96eaa64fc44a4937e80d5db44f91a42813e5cb7f6b58ec3ce392e0fa0f4202616285108a9f0a5ce972540d7a  py3-service_identity-23.1.0.tar.gz
7e1c6f10c65defb565df310f3231125454ea7b20dbb9cf9ebc4d117a3b93f162c196ed1badc31a218cc3ef6f592b836a179f37fad81b8c07f7abb7bfc04c6086  remove-fancy-pypi-readme.patch
"
